<template>
 
	<u-tabbar fixed :value="current" activeColor="#ff0101">
		<u-tabbar-item text="首页" @click="goPage('/pages/index/index')" :name="0">
			<image class="u-page__item__slot-icon" slot="active-icon" src='../static/bar/index.png'></image>
			<image class="u-page__item__slot-icon" slot="inactive-icon" src="../static/bar/index.png"></image>
		</u-tabbar-item>
		<u-tabbar-item text="订单" @click="goPage('/pages/order/order')" :name="1">
			<image class="u-page__item__slot-icon" slot="active-icon" src='../static/bar/order.png'></image>
			<image class="u-page__item__slot-icon" slot="inactive-icon" src="../static/bar/order.png"></image>
		</u-tabbar-item>
		<u-tabbar-item text="数据" @click="goPage('/pages/report/report')" :name="2">
			<image class="u-page__item__slot-icon" slot="active-icon" src='../static/bar/report.png'></image>
			<image class="u-page__item__slot-icon" slot="inactive-icon" src="../static/bar/report.png"></image>
		</u-tabbar-item>
		<u-tabbar-item text="售后" @click="goPage('/pages/aftersales/aftersales')" :name="3">
			<image class="u-page__item__slot-icon" slot="active-icon" src='../static/bar/aftersales.png'></image>
			<image class="u-page__item__slot-icon" slot="inactive-icon" src="../static/bar/aftersales.png"></image>
		</u-tabbar-item>
		<u-tabbar-item text="我的" @click="goPage('/pages/my/my')" :name="4">
			<image class="u-page__item__slot-icon" slot="active-icon" src='../static/bar/mine.png'></image>
			<image class="u-page__item__slot-icon" slot="inactive-icon" src="../static/bar/mine.png"></image>
		</u-tabbar-item>
	</u-tabbar>
</template>

<script>
	export default {
		name: "page-tabbar",
		props: {
			offsetTop: {
				type: Number,
				default: 60
			},
			current: {
				type: {
					type: Number,
					default: 3
				}
			}
		},
		data() {
			return {

			};
		},
		methods: {
			goPage(name) {
				uni.switchTab({
					url: name
				})
				console.log(name)
			}
		}

	}
</script>

<style>
	.u-page__item__slot-icon {
		width: 40rpx;
		height: 40rpx;
	}
</style>